// ProductCase.js
var app = getApp();
Page({

  /**
   * 页面的初始数据
   */
  data: {
   
    titleList: []
     
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var that = this;
    console.log('7777:' )
    that.setData({
      isSelect: app.data.anlietype_id,
      titleList: app.data.btnList,

    })
    console.log(options);
    
  
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
  
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    var isSelect = app.data.anlietype_id
    console.log('6666:'+isSelect)
    var that = this
    that.setData({
      isSelect:isSelect
    })
    console.log('当前data')
    console.log(that.data)
    ///案例列表
    wx.request({
      url: app.data.ipconfig + 'caseapi/showModel4CaseList',

      data: { shopsNo: app.data.shopsNo, anlietype_id: that.data.isSelect, pageSize: "20" },
      header: {
        'content-type': 'application/json'
      },
      success: function (res) {

        console.log("\=====");
        console.log(res);
        that.setData({
          Listdates: res.data.res.Listdates,

        })
      },
      fail: function () {
        console.log("接口出现异常");
      }
    })
  
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {
  
  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
  
  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
  
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
  
  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
  
  },
  clickTop:function(e)
  {
    var typeId = e.currentTarget.dataset.id;
    var that = this;
    console.log(e);
    that.setData({
      isSelect: typeId
    });
    wx.request({
      url: app.data.ipconfig + 'caseapi/showModel4CaseList',

      data: { shopsNo: app.data.shopsNo, anlietype_id: that.data.isSelect, pageSize: "20" },
      header: {
        'content-type': 'application/json'
      },
      success: function (res) {

        console.log("\=====");
        console.log(res);
        that.setData({
          Listdates: res.data.res.Listdates,

        })
      },
      fail: function () {
        console.log("接口出现异常");
      }
    });
  },
  lookdetail: function (e) {
    var lookid = e.currentTarget.dataset.id;
    console.log(lookid);
    
    wx.navigateTo({
      url: "/pages/companyDetail/companyDetail?id=" + lookid + "&type=" + 2
    })
  }
})